<template>
  <div>Home</div>
  <button @click="getHomeData('abc')">获取home data数据(重复的请求)</button>
  <button @click="getHomeData('cba')">获取home data数据(非重复的请求)</button>
  <br>
  <br>
  <router-link to="/about">去About页面</router-link>
</template>

<script lang="ts">
export default {
  name: "Home",
};
</script>

<script lang="ts" setup>
import { onMounted } from "vue";
import { getHomeDataApi } from "../../api/index";

const getHomeData = async (name: string) => {
  const res = await getHomeDataApi(name);
  console.log(res);
};

onMounted(() => {
  getHomeData('abc')
});
</script>

<style scoped></style>
